100 CALL CLEAR
110 REM  COPYRIGHT 1982 APEX TRADING LTD. 
120 CALL SCREEN(16)
130 DIM C(20,3)
140 RANDOMIZE
150 DEF RFA=INT(RND*20+1)
160 DEF RFB=INT(RND*3)+1
170 DEF RFC=INT(RND*4+1)
180 PRINT "WUMPUS": :
190 INPUT "do you need instructions? ":Q$
200 PRINT : :
210 IF(SEG$(Q$,1,1)="N")+(SEG$(Q$,1,1)="n")THEN 400
220 PRINT "the wumpus is a large hungrycreature that lives in a    cave of 20 rooms.";
230 PRINT "each room has 3 tunnels     leading to other rooms.": : : :
240 PRINT "you have 5 ""magic arrows""   with which to hunt the      wumpus.": :
250 PRINT "each arrow can travel a     distance of between 1 to 5  rooms.": :
260 PRINT "just tell it the route, but be warned. if it passes     through your room then you  lose!": :
270 INPUT "press enter to continue":Q$
280 PRINT : :
290 PRINT "there are 3 hazards, bottom-less pits, super-bats, whichmove you around the cave at ";
300 PRINT "random, and of course, the  wumpus who will eat you!": :
310 PRINT "the wumpus will either move";
320 PRINT "one room or keep still when";
330 PRINT "you shoot an arrow or if you";
340 PRINT "walk into his room.": :
350 PRINT "you will be warned when you";
360 PRINT "are one room away from any";
370 PRINT "hazard.": :
380 PRINT "it's a good idea to make a  map of the inter-connectionsas you go!": :
390 PRINT "ensure that the alpha lock  on your computer is in the  on position before starting.": :
400 FOR J=1 TO 20
410 FOR K=1 TO 3
420 READ C(J,K)
430 NEXT K
440 NEXT J
450 FOR J=1 TO 6
460 L(J)=RFA
470 M(J)=L(J)
480 NEXT J
490 FOR J=1 TO 6
500 FOR K=J TO 6
510 IF K=J THEN 530
520 IF L(J)=L(K)THEN 460
530 NEXT K
540 NEXT J
550 AR=5
560 INPUT "press enter to start":Q$
570 PRINT : : : :
580 LS=L(1)
590 GOSUB 780
600 GOSUB 930
610 ON FL GOTO 620,650
620 GOSUB 1020
630 IF F=0 THEN 590
640 GOTO 670
650 GOSUB 1460
660 IF F=0 THEN 590
670 IF F>0 THEN 700
680 PRINT "you lose!": :
690 GOTO 710
700 PRINT "you win this time, but watchout!": :
710 FOR I=1 TO 6
720 L(I)=M(I)
730 NEXT I
740 INPUT "another game? ":Q$
750 PRINT : : : : : :
760 IF SEG$(Q$,1,1)="Y" THEN 450 ELSE 1720
770 GOTO 450
780 REM  **LOCATION**** 
790 FOR J=2 TO 6
800 FOR K=1 TO 3
810 IF C(L(1),K)<>L(J)THEN 880
820 ON J-1 GOTO 830,850,850,870,870
830 PRINT "a wumpus nearby!": :
840 GOTO 880
850 PRINT "i feel a draft! pits near.": :
860 GOTO 880
870 PRINT "bats about!": :
880 NEXT K
890 NEXT J
900 PRINT "you are in room";L(1): :
910 PRINT "tunnels lead to";C(LS,1);C(LS,2);C(LS,3): :
920 RETURN
930 REM  *CHOOSE OPTION*** 
940 INPUT "shoot or move (S/M)? ":Q$
950 PRINT : :
960 IF Q$<>"S" THEN 990
970 FL=1
980 RETURN
990 IF Q$<>"M" THEN 940
1000 FL=2
1010 RETURN
1020 REM  ***ARROW*** 
1030 F=0
1040 LS=L(1)
1050 INPUT "number of rooms (1 to 5)? ":Q
1060 PRINT : :
1070 IF(Q<1)+(Q>5)THEN 1050
1080 FOR J=1 TO Q
1090 INPUT "through room no.? ":P(J)
1100 PRINT : :
1110 IF J<=2 THEN 1150
1120 IF P(J)<>P(J-2)THEN 1150
1130 PRINT "your arrows aren't that     magic!": :
1140 GOTO 1090
1150 NEXT J
1160 FOR J=1 TO Q
1170 FOR K=1 TO 3
1180 IF C(LS,K)=P(J)THEN 1300
1190 NEXT K
1200 LS=C(LS,RFB)
1210 GOTO 1310
1220 NEXT J
1230 PRINT "you missed!": :
1240 LS=L(1)
1250 GOSUB 1390
1260 AR=AR-1
1270 IF AR>0 THEN 1290
1280 F=-1
1290 RETURN
1300 LS=P(J)
1310 IF LS<>L(2)THEN 1350
1320 PRINT "you got the wumpus!": :
1330 F=1
1340 RETURN
1350 IF LS<>L(1)THEN 1220
1360 PRINT "shot by your own arrow!": :
1370 GOTO 1280
1380 REM  
1390 K=RFC
1400 IF K=4 THEN 1420
1410 L(2)=C(L(2),K)
1420 IF L(2)<>LS THEN 1450
1430 PRINT "aagh! the wumpus ate you!": :
1440 F=-1
1450 RETURN
1460 REM   ****MOVE***** 
1470 F=0
1480 INPUT "where to? ":LS
1490 PRINT : : : :
1500 IF(LS<1)+(LS>20)THEN 1480
1510 FOR J=1 TO 3
1520 IF C(L(1),J)=LS THEN 1570
1530 NEXT J
1540 IF LS=L(1)THEN 1570
1550 PRINT "thats not possible!": :
1560 GOTO 1480
1570 L(1)=LS
1580 IF LS<>L(2)THEN 1630
1590 PRINT "you bumped into the wumpus, better watch out!": :
1600 GOSUB 1390
1610 IF F=0 THEN 1630
1620 RETURN
1630 IF(LS<>L(3))*(LS<>L(4))THEN 1670
1640 PRINT "aaaaaaaargh!!! you fell intothe bottomless pit!": :
1650 F=-1
1660 RETURN
1670 IF(LS<>L(5))*(LS<>L(6))THEN 1710
1680 PRINT "super bat snatch!!": :
1690 LS=RFA
1700 GOTO 1570
1710 RETURN
1720 END
1730 DATA 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
1740 DATA 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
1750 DATA 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
1760 DATA 15,17,20,7,16,18,9,17,19,11,18,20,13,16,19
